[Rails] Cross Browser Popup size woes

Posted by stephemurdoch on Stack Overflow See other posts from Stack Overflow or by stephemurdoch
Published on 2010-06-06T07:03:41Z Indexed on 2010/06/06 7:12 UTC
Read the original article Hit count: 332

Filed under:
|
|

I need to display certain content inside a popup window, and the body element must be 320px by 300px for styling purposes

So I do the following:

%p
  = link_to "Play in popup", popup_podcast_path(@podcast), :popup => ['new_window','height=300,width=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes']

Firefox does exactly what I ask it to do, it displays a popup window, with a page body that is 320px wide and 300px high, so my content fits perfectly inside.

But Chrome includes the browser frame dimensions when sizing the popup, which means that the body element is less than the required size.... i.e. if the browser titlebar is 10px high, then this is subtracted from the space allocated to the body element

How do I tell Chrome, that I want the body element to be 320 by 300, and that I dont want it to subtract the width and height of the browser frame from body element dimensions

It's a bit like the old box-model problem where FF and IE added padding in different ways except firefox adds the browser frame outside the desired 320x300 size, and Chrome is adding it inside

© Stack Overflow or respective owner

Related posts about firefox

Related posts about google-chrome